import { request } from '@/plugins/request'

//获取用户简介信息
export const getProfile = username => {
    return request({
        method: 'GET',
        url: `/profiles/${username}`
    })
}

//关注用户
export const followUser = username => {
    return request({
        method: 'POST',
        url: `/profiles/${username}/follow`,
    })
}

//取消关注用户
export const unFollowUser = username => {
    return request({
        method: 'DELETE',
        url: `/profiles/${username}/follow`,
    })
}

//用户注册
export const updateUser = data => {
    return request({
        method: 'PUT',
        url: '/user',
        data
    })
}